//进入全屏
export const enterFullscreen = (ele: any) => {
  if (ele.requestFullscreen) {
    // Chrome等
    ele.requestFullscreen();
  } else if (ele.mozRequestFullScreen) {
    // Firefox
    ele.mozRequestFullScreen();
  } else if (ele.msRequestFullscreen) {
    // IE11
    ele.msRequestFullscreen();
  } else if (ele.webkitRequestFullscreen) {
    // Safari等
    // @ts-ignore
    ele.webkitRequestFullscreen();
  }
};
//退出全屏
export const exitFullscreen = () => {
  document;
  if (document.exitFullscreen) {
    // W3C
    document.exitFullscreen();
  } else if (document.mozCancelFullScreen) {
    // Firefox
    document.mozCancelFullScreen();
  } else if (document.msExitFullscreen) {
    // IE11
    document.msExitFullscreen();
  } else if (document.webkitExitFullscreen) {
    // Safari等
    // @ts-ignore
    document.webkitExitFullscreen();
  }
};
//当前是否处于全屏状态
export const isFull = () => {
  const fullScreenEle = document.fullscreenElement || document.msFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement;
  if (fullScreenEle === null) {
    return false;
  } else {
    return true;
  }
};
//切换全屏状态
export const toggleFullscreen = (ele: any) => {
  console.log(isFull());
};
